From 448ec440c8777ab5267e973fb96657fceda56dd2 Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Fri, 16 Sep 2005 16:54:53 -0600 Subject: [PATCH] Add additional stats to track VHPT saturation --- xen/arch/ia64/xen/privop.c | 2 ++ xen/arch/ia64/xen/vhpt.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/xen/arch/ia64/xen/privop.c b/xen/arch/ia64/xen/privop.c index f648144e4b..1c13823d4f 100644 --- a/xen/arch/ia64/xen/privop.c +++ b/xen/arch/ia64/xen/privop.c @@ -1107,6 +1107,7 @@ int dump_privop_counts_to_user(char __user *ubuf, int len) #ifdef PRIVOP_ADDR_COUNT n += dump_privop_addrs(buf + n); #endif + n += dump_vhpt_stats(buf + n); n += dump_misc_stats(buf + n); if (len < TMPBUFLEN) return -1; if (__copy_to_user(ubuf,buf,n)) return -1; @@ -1122,6 +1123,7 @@ int zero_privop_counts_to_user(char __user *ubuf, int len) #ifdef PRIVOP_ADDR_COUNT zero_privop_addrs(); #endif + zero_vhpt_stats(); zero_misc_stats(); zero_reflect_counts(); if (len < TMPBUFLEN) return -1; diff --git a/xen/arch/ia64/xen/vhpt.c b/xen/arch/ia64/xen/vhpt.c index 0eca1abdf3..1cf305f0a1 100644 --- a/xen/arch/ia64/xen/vhpt.c +++ b/xen/arch/ia64/xen/vhpt.c @@ -149,3 +149,24 @@ void vhpt_init(void) vhpt_flush(); } + +void zero_vhpt_stats(void) +{ + return; +} + +int dump_vhpt_stats(char *buf) +{ + int i; + char *s = buf; + struct vhpt_lf_entry *v = (void *)VHPT_ADDR; + unsigned long vhpt_valid = 0, vhpt_chains = 0; + + for (i = 0; i < VHPT_NUM_ENTRIES; i++, v++) { + if (!(v->ti_tag & INVALID_TI_TAG)) vhpt_valid++; + if (v->CChain) vhpt_chains++; + } + s += sprintf(s,"VHPT usage: %ld/%ld (%ld collision chains)\n", + vhpt_valid,VHPT_NUM_ENTRIES,vhpt_chains); + return s - buf; +} -- 2.30.2